import { cmsRequest } from '@/request'

export const fetchPlantList = (payload: any) => {
  return cmsRequest.post('/plant/plant-info/query', payload)
}

export const fetchPlantInsertOne = (payload: any) => {
  return cmsRequest.post('/plant/plant-info/insertOne', payload)
}

export const fetchPlantUpdate = (payload: any) => {
  return cmsRequest.put('/plant/plant-info/upateById', payload)
}

export const fetchPlantDetail = (id: number) => {
  return cmsRequest.get(`/plant/plant-info/${id}`)
}

export const fetchPlantDelete = (id: number) => {
  return cmsRequest.delete(`/plant/plant-info/${id}`)
}

export const fetchPlantTemp = () => {
  window.open(`${import.meta.env.VITE_BASE_URL}/plant/plant-info/downPlantInfoTemplate`)
}